package com.shrct.businessprocess.budget;

import com.shrct.businessprocess.project.RCProject;
import com.shrct.businessprocess.project.impl.RCProjectImpl;
import edu.fudan.mylang.pf.test.BaseTest;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration(locations = "classpath:HibernateApplicationContext-test.xml")
public class InitializeProject extends BaseTest {
  public InitializeProject() {
    super();
  }
  
  @Autowired
  private MailSender mailSender;
  
  @Test
  public void testMail() {
    SimpleMailMessage _simpleMailMessage = new SimpleMailMessage();
    final SimpleMailMessage message = _simpleMailMessage;
    message.setSubject("CASE \u5347\u7EA7\u901A\u77E5,CASE\u53F7:");
    message.setTo("ztiange@fudan.edu.cn");
    message.setFrom("caseadmin@shrct.com");
    final String msgBody = "just test";
    message.setText(msgBody);
    this.mailSender.send(message);
  }
  
  @Test
  public void createProject() {RCProject rCProject=RCProjectImpl.create(getObjectFactory());
    final Procedure1<RCProject> _function = new Procedure1<RCProject>() {
        public void apply(final RCProject project) {
        }
      };
    ObjectExtensions.<RCProject>operator_doubleArrow(rCProject, _function);
  }
}
